package org.example.DesignPatterns.Factory.OperationFactory;

/**
 * @description:
 * @author: farprt
 * @create: 2022-03-09 22:02
 **/
public class OperationDiv extends Operation{
    @Override
    public double getResult() throws Exception {
        double result=0;
        if(getNumberB()==0){
            throw new Exception("除数不能为0");
        }
        result=getNumberA() / getNumberB();
        return result;
    }
}